
    TestCase
    (
        'ie.ondevice.objectkit.EcmasScriptForInTestCase'
        
    ,   {
            
            testForInLoop: function () 
            {
                
                function A () {;};
                A.prototype.propertyA= new Object
                
                B.inherit(A);
                function B () {;};
                B.prototype.propertyB= new Object;
                
                C.inherit(B);
                function C () {;};
                C.prototype.propertyC= new Object;
                
                var o= new Object;
                
                function qualifiesAsEmpty (o) 
                {
                    for (var a in o)
                        return false;
                        
                    return true;
                }
                
                assertTrue('native Object qualify as empty', qualifiesAsEmpty(new Object));
                // all browsers agree that a function is not empty- is this the prototype?
                /*
                assertFalse('native Function does not qualify as empty', qualifiesAsEmpty(new Function));
                assertTrue('native Array qualify as empty', qualifiesAsEmpty(new Array));
                assertTrue('native RegExp qualify as empty', qualifiesAsEmpty(new RegExp));
                
                // Internet Explorer does not consider String, Boolean or Number objects as empty
                if (window.ActiveXObject) 
                {
                    assertFalse('native String does not qualify as empty', qualifiesAsEmpty(new String));
                    assertFalse('native Boolean does not qualify as empty', qualifiesAsEmpty(new Boolean));
                    assertFalse('native Number does not qualify as empty', qualifiesAsEmpty(new Number));
                }
                else
                {
                    assertTrue('native String qualify as empty', qualifiesAsEmpty(new String));
                    assertTrue('native Boolean qualify as empty', qualifiesAsEmpty(new Boolean));
                    assertTrue('native Number qualify as empty', qualifiesAsEmpty(new Number));
                }
                */
                /*
                switch (true) 
                {
                    case /gecko/.test(window.navigator) : 
                    {
                        
                    }
                    
                    case /webkit/.test(window.navigator) : 
                    {
                        
                    }
                }
                */
                
                // in rgards to Error, Firefox and chrome disagree, but opera and safari do
                //assertTrue('native Error qualify as empty', qualifiesAsEmpty(new Error));
                            
                assertFalse('Custom objects never qualify as empty', qualifiesAsEmpty(new A));
                
                var properties= [];
                var constructors= [];
                var parents= [];
                var subject= new C;
                var trait;
                var names= [];
                for (var a in subject) 
                {
                    names.push(a);
                    trait= subject[a];
                    switch (a) 
                    {
                        case 'parent' : parents.push(trait); break;
                        case 'constructor' : constructors.push(trait); break;
                        default : properties.push(trait);
                    }
                }
                
                // throw names;
                
                assertEquals('Three properties were enumerated', 3, properties.length);
                assertEquals('One parent was enumerated', 1, parents.length);
                
                if (window.ActiveXObject) // MSIE does not pick up on the constructor property
                {
                     assertEquals('No constructor was enumerated', 0, constructors.length);
                     // but that does not interfere with the ObjectKit object model as
                     // its still accessible as a property
                     assertEquals('The constructor is C', C, subject.constructor);
                }
                else
                {
                    assertEquals('1 constructor was enumerated', 1, constructors.length);
                }
               
                
            }
        }
    );
